//tow
BTC_tow_driver   = [];
BTC_tow         = 1;
BTC_towed       = 0;
BTC_tow_min_h   = -10;
BTC_tow_max_h   = 20;
BTC_tow_radius  = 8;
BTC_cargo_towed = objNull;
BTC_towable     = ["LandVehicle","car","Air","Ship","Motorcycle","Helicopter","Chopper"];
BTC_Hud_Cond     = false;
BTC_HUD_x        = (SafeZoneW+2*SafeZoneX) + 0.045;
BTC_HUD_y        = (SafeZoneH+2*SafeZoneY) + 0.045;
_tow = [] execVM "=BTC=_LogisticTow\=BTC=_tow\=BTC=_towInit.sqf";
//Functions
BTC_get_towable_array =
{
   _LandVehicle = _this select 0;
   _array   = [];
   switch (typeOf _LandVehicle) do
   {
	  case "UAZ_Unarmed_TK_EP1"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "UAZ_Unarmed_TK_CIV_EP1"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "UAZ_Unarmed_UN_EP1"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "UAZ_RU"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "ATV_US_EP1"    : {_array = ["car","Motorcycle"];};
	  case "ATV_CZ_EP1"    : {_array = ["car","Motorcycle"];};
	  case "SkodaBlue"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "Skoda"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "SkodaGreen"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "hilux1_civil_3_open"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "Ikarus_TK_CIV_EP1"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "Ikarus"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "Tractor"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "S1203_TK_CIV_EP1"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "V3S_Civ"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "UralCivil"    : {_array = ["Truck","LandVehicle","car","Ship","Motorcycle"];};
	  case "car_hatchback"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "Volha_2_TK_CIV_EP1"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "Volha_1_TK_CIV_EP1"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "SUV_TK_CIV_EP1"    : {_array = ["Truck","LandVehicle","car","Ship","Motorcycle"];};
	  case "car_sedan"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "hilux1_civil_3_open_EP1"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "UralCivil2"    : {_array = ["Truck","LandVehicle","car","Ship","Motorcycle"];};
	  case "LandRover_CZ_EP1"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "BW_Ikarus1"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "BW_Ikarus2"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "kpfs_golf_g"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "kpfs_golf_p"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "kpfs_golf_post"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "kpfs_golf_tk"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "Lada1_GDR"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "Lada2_GDR"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "Lada2_TK_CIV_EP1"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "Lada4_GDR"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "Lada5_GDR"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "TT650_Civ"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "TT650_Gue"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "MTVR"    : {_array = ["Truck","LandVehicle","car","Ship","Motorcycle","CH_47F_EP1"];};
	  case "MTVR_DES_EP1"    : {_array = ["Truck","LandVehicle","car","Ship","Motorcycle","BAF_Merlin_HC3_D"];};
	  case "MTVR_Refuel_DES_EP1"    : {_array = ["Truck","LandVehicle","car","Ship","Motorcycle"];};
	  case "KamazOpen"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "BAF_Offroad_D"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "BAF_Offroad_W"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "datsun1_civil_3_open"    : {_array = ["LandVehicle","Ship","Motorcycle"];};
	  case "datsun1_civil_2_covered"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "GAZ_Vodnik"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "LAV25_HQ"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "BRDM2_HQ_Gue"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "hilux1_civil_1_open"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "hilux1_civil_2_covered"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "Lada"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "Lada1"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "Lada1_TK_CIV_EP1"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "LadaLM"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "LandRover_TK_CIV_EP1"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "MMT_Civ"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "Old_moto_TK_Civ_EP1"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "S1203_ambulance_EP1"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "SkodaRed"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "TowingTractor"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "VWGolf"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "VolhaLimo_TK_CIV_EP1"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "UralRefuel_INS"    : {_array = ["Truck","LandVehicle","car","Ship","Motorcycle"];};
	  case "Ural_INS"    : {_array = ["Truck","LandVehicle","car","Ship","Motorcycle"];};
	  case "HMMWV_DES_EP1"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "KamazRefuel"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "kamaz_refuel"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "UAZ_MG_INS"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "KamazRepair"    : {_array = ["Truck","LandVehicle","car","Ship","Motorcycle"];};
	  case "UralRepair_INS"    : {_array = ["Truck","LandVehicle","car","Ship","Motorcycle"];};
	  case "M1A2_TUSK_Unarmed"    : {_array = ["Truck","LandVehicle","car","Ship","Motorcycle"];};
	  case "T90_Unarmed"    : {_array = ["Truck","LandVehicle","car","Ship","Motorcycle"];};
	  case "ZSU_TK_EP1"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "Ural_CDF"    : {_array = ["Truck","LandVehicle","car","Ship","Motorcycle"];};
	  case "GAZ_Vodnik_MedEvac"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "GAZ_Vodnik_DZ_LM"    : {_array = ["LandVehicle","car","Ship","Motorcycle"];};
	  case "BTR40_TK_GUE_EP1"    : {_array = ["Truck","ATV","LandVehicle","car","Ship","Motorcycle"];};
	  case "BTR40_TK_INS_EP1"    : {_array = ["Truck","ATV","LandVehicle","car","Ship","Motorcycle"];};
	  case "M1126_ICV_M2_EP1"    : {_array = ["Truck","ATV","LandVehicle","Wheeled_APC","Tracked_APC","car","Ship","Motorcycle"];};
	  case "M1133_MEV_EP1"    : {_array = ["Truck","ATV","LandVehicle","Wheeled_APC","Tracked_APC","car","Ship","Motorcycle"];};
	  case "BTR90"    : {_array = ["Truck","ATV","LandVehicle","Wheeled_APC","Tracked_APC","car","Ship","Motorcycle"];};
	  case "BTR90_HQ"    : {_array = ["Truck","ATV","LandVehicle","Wheeled_APC","Tracked_APC","car","Ship","Motorcycle"];};
	  case "BAF_FV510_W"   : {_array = ["Truck","ATV","LandVehicle","Wheeled_APC","Tracked_APC","car","Ship","Motorcycle"];};
	  case "BAF_FV510_D"   : {_array = ["Truck","ATV","LandVehicle","Wheeled_APC","Tracked_APC","car","Ship","Motorcycle"];};
	  case "BTR60_TK_EP1"   : {_array = ["Truck","ATV","LandVehicle","Wheeled_APC","Tracked_APC","car","Ship","Motorcycle","AH64D_EP1","Mi24_D","Mi17_CDF","Mi17_INS","AH6X_DZ","UH1H_DZ","AH1Z","AH64D","F35B","MH60S","Mi17_INS","Ka52Black","Ka52","UH1Y","MV22","AH6J_EP1","AH6X_EP1","MH6J_EP1","Ka60_PMC","UH60M_EP1","Ka60_GL_PMC","Ka137_PMC","Ka137_MG_PMC","BAF_Merlin_HC3_D","MH6J_DZ","Mi17_DZ","CH47_DZ","F35R","Mi171Sh_rockets_CZ_EP1","BAF_Apache_AH1_D","AC130","CSJ_HHMKIIA"];};
	  case "BRDM2_INS"   : {_array = ["Truck","ATV","LandVehicle","Wheeled_APC","Tracked_APC","car","Ship","Motorcycle","AH64D_EP1","Mi24_D","Mi17_CDF","Mi17_INS","AH6X_DZ","UH1H_DZ","AH1Z","AH64D","F35B","MH60S","Mi17_INS","Ka52Black","Ka52","UH1Y","MV22","AH6J_EP1","AH6X_EP1","MH6J_EP1","Ka60_PMC","UH60M_EP1","Ka60_GL_PMC","Ka137_PMC","Ka137_MG_PMC","BAF_Merlin_HC3_D"];};
	  case "BRDM2_ATGM_INS"   : {_array = ["Truck","ATV","LandVehicle","Wheeled_APC","Tracked_APC","car","Ship","Motorcycle","AH64D_EP1","Mi24_D","Mi17_CDF","Mi17_INS","AH6X_DZ","UH1H_DZ","AH1Z","AH64D","F35B","MH60S","Mi17_INS","Ka52Black","Ka52","UH1Y","MV22","AH6J_EP1","AH6X_EP1","MH6J_EP1","Ka60_PMC","UH60M_EP1","Ka60_GL_PMC","Ka137_PMC","Ka137_MG_PMC","BAF_Merlin_HC3_D"];};
	  case "ArmoredSUV_PMC"  : {_array = ["Truck","ATV","LandVehicle","Wheeled_APC","Tracked_APC","car","Ship","Motorcycle","AH64D_EP1","Mi24_D","Mi17_CDF","Mi17_INS","AH6X_DZ","UH1H_DZ","AH1Z","AH64D","F35B","MH60S","Mi17_INS","Ka52Black","Ka52","UH1Y","MV22","AH6J_EP1","AH6X_EP1","MH6J_EP1","Ka60_PMC","UH60M_EP1","Ka60_GL_PMC","Ka137_PMC","Ka137_MG_PMC","BAF_Merlin_HC3_D","MH6J_DZ","Mi17_DZ","CH47_DZ","F35R","Mi171Sh_rockets_CZ_EP1","BAF_Apache_AH1_D","AC130","CSJ_HHMKIIA","AV8B2_Unarmed","AH1Z_Unarmed","AH6J_Unarmed","Su25_Unarmed","Su34_Unarmed","Su39_Unarmed","F35B_Unarmed","A10_Unarmed","Ka52Black_Unarmed","AW159_Lynx_BAF_Unarmed","UH1Y_Unarmed","BAF_Apache_AH1_Unarmed","Mi24_Unarmed","CSJ_P38","CSJ_109E","CSJ_109G","CSJ_Spitfire","kyo_MH47E_HC"];};
	  case "MaxxM2rh"  : {_array = ["Truck","ATV","LandVehicle","Wheeled_APC","Tracked_APC","car","Ship","Motorcycle","AH64D_EP1","Mi24_D","Mi17_CDF","Mi17_INS","AH6X_DZ","UH1H_DZ","AH1Z","AH64D","F35B","MH60S","Mi17_INS","Ka52Black","Ka52","UH1Y","MV22","AH6J_EP1","AH6X_EP1","MH6J_EP1","Ka60_PMC","UH60M_EP1","Ka60_GL_PMC","Ka137_PMC","Ka137_MG_PMC","BAF_Merlin_HC3_D","MH6J_DZ","Mi17_DZ","CH47_DZ","F35R","Mi171Sh_rockets_CZ_EP1","BAF_Apache_AH1_D","AC130","CSJ_HHMKIIA","AV8B2_Unarmed","AH1Z_Unarmed","AH6J_Unarmed","Su25_Unarmed","Su34_Unarmed","Su39_Unarmed","F35B_Unarmed","A10_Unarmed","Ka52Black_Unarmed","AW159_Lynx_BAF_Unarmed","UH1Y_Unarmed","BAF_Apache_AH1_Unarmed","Mi24_Unarmed","CSJ_P38","CSJ_109E","CSJ_109G","CSJ_Spitfire","kyo_MH47E_HC"];};
	  case "MaxxM134rh"  : {_array = ["Truck","ATV","LandVehicle","Wheeled_APC","Tracked_APC","car","Ship","Motorcycle","AH64D_EP1","Mi24_D","Mi17_CDF","Mi17_INS","AH6X_DZ","UH1H_DZ","AH1Z","AH64D","F35B","MH60S","Mi17_INS","Ka52Black","Ka52","UH1Y","MV22","AH6J_EP1","AH6X_EP1","MH6J_EP1","Ka60_PMC","UH60M_EP1","Ka60_GL_PMC","Ka137_PMC","Ka137_MG_PMC","BAF_Merlin_HC3_D","MH6J_DZ","Mi17_DZ","CH47_DZ","F35R","Mi171Sh_rockets_CZ_EP1","BAF_Apache_AH1_D","AC130","CSJ_HHMKIIA","AV8B2_Unarmed","AH1Z_Unarmed","AH6J_Unarmed","Su25_Unarmed","Su34_Unarmed","Su39_Unarmed","F35B_Unarmed","A10_Unarmed","Ka52Black_Unarmed","AW159_Lynx_BAF_Unarmed","UH1Y_Unarmed","BAF_Apache_AH1_Unarmed","Mi24_Unarmed","CSJ_P38","CSJ_109E","CSJ_109G","CSJ_Spitfire","kyo_MH47E_HC"];};
	  case "towingtractor"  : {_array = ["Truck","ATV","LandVehicle","Wheeled_APC","Tracked_APC","car","Ship","Motorcycle","AH64D_EP1","Mi24_D","Mi17_CDF","Mi17_INS","AH6X_DZ","UH1H_DZ","AH1Z","AH64D","F35B","MH60S","Mi17_INS","Ka52Black","Ka52","UH1Y","MV22","AH6J_EP1","AH6X_EP1","MH6J_EP1","Ka60_PMC","UH60M_EP1","Ka60_GL_PMC","Ka137_PMC","Ka137_MG_PMC","BAF_Merlin_HC3_D","MH6J_DZ","Mi17_DZ","CH47_DZ","F35R","Mi171Sh_rockets_CZ_EP1","BAF_Apache_AH1_D","AC130","CSJ_HHMKIIA","AV8B2_Unarmed","AH1Z_Unarmed","AH6J_Unarmed","Su25_Unarmed","Su34_Unarmed","Su39_Unarmed","F35B_Unarmed","A10_Unarmed","Ka52Black_Unarmed","AW159_Lynx_BAF_Unarmed","UH1Y_Unarmed","BAF_Apache_AH1_Unarmed","Mi24_Unarmed","CSJ_P38","CSJ_109E","CSJ_109G","CSJ_Spitfire","kyo_MH47E_HC"];};
	  case "pook_M1161_amb"  : {_array = ["Truck","ATV","LandVehicle","car","Ship","Motorcycle"];};
	  case "tractorOld"    : {_array = ["Truck","ATV","LandVehicle","car","Motorcycle","AH64D_EP1","Mi24_D","Mi17_CDF","Mi17_INS","AH6X_DZ","UH1H_DZ","AH1Z","AH64D","F35B","MH60S","Mi17_INS","Ka52Black","Ka52","UH1Y","MV22","AH6J_EP1","AH6X_EP1","MH6J_EP1","Ka60_PMC","UH60M_EP1","Ka60_GL_PMC","Ka137_PMC","Ka137_MG_PMC","BAF_Merlin_HC3_D","MH6J_DZ","Mi17_DZ","CH47_DZ","F35R","Mi171Sh_rockets_CZ_EP1","BAF_Apache_AH1_D","AC130","CSJ_HHMKIIA","AV8B2_Unarmed","AH1Z_Unarmed","AH6J_Unarmed","Su25_Unarmed","Su34_Unarmed","Su39_Unarmed","F35B_Unarmed","A10_Unarmed","Ka52Black_Unarmed","AW159_Lynx_BAF_Unarmed","UH1Y_Unarmed","BAF_Apache_AH1_Unarmed","Mi24_Unarmed","CSJ_P38","CSJ_109E","CSJ_109G","CSJ_Spitfire","kyo_MH47E_HC"];};
	  case "MaxxPro"    : {_array = ["Truck","ATV","LandVehicle","Wheeled_APC","Tracked_APC","car","Ship","Motorcycle"];};
	  case "MaxxProrh"    : {_array = ["Truck","ATV","LandVehicle","Wheeled_APC","Tracked_APC","car","Ship","Motorcycle"];};
	  case "MaxxM2"    : {_array = ["Truck","ATV","LandVehicle","Wheeled_APC","Tracked_APC","car","Ship","Motorcycle"];};
	  case "SUV_Blue"    : {_array = ["Truck","ATV","LandVehicle","car","Ship","Motorcycle","UH60M_MEV_EP1"];};
	  case "SUV_Green"    : {_array = ["Truck","ATV","LandVehicle","car","Ship","Motorcycle","MH6J_EP1","AH6X_DZ"];};
	  case "SUV_Yellow"    : {_array = ["Truck","ATV","LandVehicle","car","Ship","Motorcycle","Ka60_PMC"];};
	  case "SUV_Red"    : {_array = ["Truck","ATV","LandVehicle","car","Ship","Motorcycle","UH60M_EP1"];};
	  case "SUV_White"    : {_array = ["Truck","ATV","LandVehicle","car","Ship","Motorcycle","Mi17_CDF"];};
	  case "SUV_Pink"    : {_array = ["Truck","ATV","LandVehicle","car","Ship","Motorcycle","UH1Y_Unarmed","UH1Y"];};
	  case "SUV_Charcoal"    : {_array = ["Truck","ATV","LandVehicle","car","Ship","Motorcycle"];};
	  case "SUV_Orange"    : {_array = ["Truck","ATV","LandVehicle","car","Ship","Motorcycle","UH1H_DZ"];};
	  case "SUV_Silver"    : {_array = ["Truck","ATV","LandVehicle","car","Ship","Motorcycle"];};
	  case "pook_M1161_M2"    : {_array = ["Truck","ATV","LandVehicle","car","Ship","Motorcycle"];};
	  case "pook_M1161_Mk19"    : {_array = ["Truck","ATV","LandVehicle","car","Ship","Motorcycle"];};
	  case "pook_M1161_M2_SOV"    : {_array = ["Truck","ATV","LandVehicle","car","Ship","Motorcycle"];};
	  case "pook_M1161_Mk19_SOV"    : {_array = ["Truck","ATV","LandVehicle","car","Ship","Motorcycle"];};
   };
   _array
};
BTC_obj_fall =
{
   _obj    = _this select 0;
   _height = getPos _obj select 2;
   _fall   = 0.09;
   while {(getPos _obj select 2) > 1} do
   {

      _fall = (_fall * 1.1);
      _obj setPos [getPos _obj select 0, getPos _obj select 1, _height];
      _height = _height - _fall;
      sleep 0.01;
   };
   _obj setPos [getPos _obj select 0, getPos _obj select 1, 0];
};
BTC_paradrop =
{
   _Veh          = _this select 0;
   _dropped      = _this select 1;
   _chute_type   = _this select 2;
   private ["_chute"];
   _dropped_type = typeOf _dropped;
   if (typeOf _Veh == "MH6J_EP1") then {_chute = createVehicle [_chute_type, [((position _Veh) select 0) - 5,((position _Veh) select 1) - 10,((position _Veh) select 2)- 4], [], 0, "NONE"];} else {_chute = createVehicle [_chute_type, [((position _Veh) select 0) - 5,((position _Veh) select 1) - 3,((position _Veh) select 2)- 4], [], 0, "NONE"];};
   _smoke        = "SmokeShellYellow1" createVehicle position _Veh;
    _smoke attachto [_dropped,[0,0,0]];
   _dropped attachTo [_chute,[0,0,0]];
   while {getPos _chute select 2 > 2} do {sleep 1;};
   detach _dropped;
};
BTC_hint = {_text  = _this select 0;_sleep = _this select 1;hintSilent _text;sleep _sleep;hintSilent "";};